package com.example.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.util.Date;

/**
 * 讲座请求DTO
 * 用于创建和更新讲座的请求参数
 */
@Data
@Schema(description = "讲座请求数据传输对象")
public class LectureRequestDTO {

    @Schema(description = "讲座标题", example = "Java并发编程实战")
    @NotBlank(message = "讲座标题不能为空")
    @Size(max = 255, message = "讲座标题不能超过255个字符")
    private String title;

    @Schema(description = "主讲人", example = "张教授")
    @NotBlank(message = "主讲人不能为空")
    @Size(max = 100, message = "主讲人姓名不能超过100个字符")
    private String lecturer;

    @Schema(description = "讲座描述", example = "深入探讨Java并发编程的核心概念和实践技巧")
    @Size(max = 1000, message = "讲座描述不能超过1000个字符")
    private String description;

    @Schema(description = "开始时间", example = "2025-08-25 14:00:00")
    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @Schema(description = "结束时间", example = "2025-08-25 16:00:00")
    @NotNull(message = "结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @Schema(description = "地点", example = "图书馆多功能厅")
    @Size(max = 200, message = "地点不能超过200个字符")
    private String location;

    @Schema(description = "人数限制", example = "50")
    @Min(value = 0, message = "人数限制不能为负数")
    private Integer participantLimit;

    @Schema(description = "讲座类型", example = "技术分享")
    @Size(max = 50, message = "讲座类型不能超过50个字符")
    private String lectureType;

    @Schema(description = "报名开始时间", example = "2025-08-20 09:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date registrationStartTime;

    @Schema(description = "报名结束时间", example = "2025-08-24 18:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date registrationEndTime;
}